package com.eidos.blogs.common.enums;

/**
 * @author ：Eidos
 * @date ：Created in 2020/12/9
 * @description：ApiEnum
 * @modified By：
 * @version: 1.0
 */
public enum ApiEnum {
    PARAM(0, "查询参数"),
    DATA(1, "查询数据");

    ApiEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    private int code;
    private String name;

    public ApiEnum getInstance(int code) {
        for (ApiEnum e : values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
